﻿using QuickGet.Core.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace QuickGet.Core.Stores
{
    public interface IPackageStore
    {
        Task SaveDownloadAsync(string packageId, string version, string path, CancellationToken cancellationToken);
        Task SaveAsync(string packageId, CancellationToken cancellationToken);

        Task<List<PackageVersionInfo>> GetDownloadedVersionsAsync(string packageId, CancellationToken cancellationToken);
        Task<string?> GetPackageDownloadPathAsync(string packageId, string version, CancellationToken cancellationToken);
        Task<List<PackageInfo>> GetListAsync(CancellationToken cancellationToken);

        string BuildPackageSavePath(string packageId, string version);

        string NormalizePackageId(string packageId);
        string NormalizePackageVersion(string version);
        string GetPackageFileName(string packageId, string version);
    }
}
